home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / graphics / wave / form1.frm next >
Text File  |  1995-06-06  |  3KB  |  120 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    BackColor       =   &H00000000&
  4.    Caption         =   "WAVE-DEMO"
  5.    ClientHeight    =   3525
  6.    ClientLeft      =   1695
  7.    ClientTop       =   2850
  8.    ClientWidth     =   5625
  9.    Height          =   3930
  10.    Left            =   1635
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   3525
  13.    ScaleWidth      =   5625
  14.    Top             =   2505
  15.    Width           =   5745
  16.    Begin CommandButton Command3 
  17.       Caption         =   "60"
  18.       Height          =   375
  19.       Left            =   120
  20.       TabIndex        =   4
  21.       Top             =   3000
  22.       Width           =   975
  23.    End
  24.    Begin CommandButton Command2 
  25.       Caption         =   "180"
  26.       Height          =   375
  27.       Left            =   2280
  28.       TabIndex        =   3
  29.       Top             =   3000
  30.       Width           =   855
  31.    End
  32.    Begin PictureBox Picture1 
  33.       AutoRedraw      =   -1  'True
  34.       Height          =   1530
  35.       Left            =   360
  36.       Picture         =   FORM1.FRX:0000
  37.       ScaleHeight     =   1500
  38.       ScaleWidth      =   4305
  39.       TabIndex        =   2
  40.       Top             =   4200
  41.       Width           =   4335
  42.    End
  43.    Begin PictureBox Picture2 
  44.       BackColor       =   &H00000000&
  45.       Height          =   1815
  46.       Left            =   120
  47.       ScaleHeight     =   1785
  48.       ScaleWidth      =   4785
  49.       TabIndex        =   1
  50.       Top             =   480
  51.       Width           =   4815
  52.    End
  53.    Begin CommandButton Command1 
  54.       Caption         =   "90"
  55.       Height          =   375
  56.       Left            =   1200
  57.       TabIndex        =   0
  58.       Top             =   3000
  59.       Width           =   975
  60.    End
  61. End
  62.  
  63. Sub Command1_Click ()
  64. '90 parts
  65. cnt% = 90
  66. Call scroll
  67. End Sub
  68.  
  69. Sub Command2_Click ()
  70. '180 parts
  71. cnt% = 180
  72. Call scroll
  73. End Sub
  74.  
  75. Sub Command3_Click ()
  76. '60 parts
  77. cnt% = 60
  78. Call scroll
  79. End Sub
  80.  
  81. Sub scroll ()
  82. form1.ScaleMode = 3
  83. picture1.ScaleMode = 3
  84. picture2.ScaleMode = 3
  85.  
  86. 'relative height of sine-wave
  87. hh% = 5
  88.  
  89. ' set up the sinewave
  90.  
  91.     For n% = 1 To cnt%
  92.         wink(n%) = Sin(3.14159 / cnt% * n% * 360 / cnt%) * hh%
  93.     Next n%
  94.     
  95. destheight = picture2.ScaleHeight
  96. faktx = picture1.ScaleWidth / cnt%
  97. destwidth% = faktx
  98.  
  99. For kk% = 1 To 3
  100. 'for 3 times
  101.     For aa% = 1 To cnt%
  102.     'for all segments
  103.         For q% = 1 To cnt%
  104.             xdest = q% * faktx
  105.             temp = BitBlt(picture2.hDC, xdest, wink(q%), destwidth% + 1, destheight, picture1.hDC, xdest, 0, SRCCOPY)
  106.         Next q%
  107.     DoEvents
  108.     'now shift the sine-wave
  109.     tmp% = wink(cnt%)
  110.         For k% = 1 To cnt%
  111.             tmp1% = wink(k%)
  112.             wink(k%) = tmp%
  113.             tmp% = tmp1%
  114.         Next k%
  115.     Next aa%
  116. Next kk%
  117.  
  118. End Sub
  119.  
  120.